import request from "@/utils/request";

// 查询供应商评价记录列表
export function login(data) {
  return request({
    url: "/app/user/login",
    method: "post",
    data,
  });
}

export function jingweidu(data) {
  return request({
    url: "/app/ztys/china",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  });
}

export function recordAdd(data) {
  return request({
    url: "/app/eightRecord/add",
    method: "post",
    data,
  });
}
export function getBazi(data) {
  return request({
    url: "/app/bazi/getBazi",
    method: "get",
    data,
  });
}
export function wxNengLing(data) {
  return request({
    url: "/app/nengliang/wxNengLing",
    method: "post",
    data,
  });
}

export function courseTypeListOne(data) {
  return request({
    url: "/app/courseType/type",
    method: "post",
    data,
  });
}
export function courseTypeList(data) {
  return request({
    url: "/app/courseType/list",
    method: "post",
    data,
  });
}
export function bannerList(data) {
  return request({
    url: "/app/banner/list",
    method: "post",
    data,
  });
}

export function listLockCourse(data) {
  return request({
    url: "/app/lockCourse/listLockCourse",
    method: "get",
    params: data,
  });
}

export function courseList(data) {
  return request({
    url: "/app/course/list",
    method: "post",
    data,
  });
}

export function lessoncartAdd(data) {
  return request({
    url: "/app/shoppingcartCourse",
    method: "post",
    data,
  });
}

export function lessoncartCount(data) {
  return request({
    url: "/app/shoppingcartCourse/count",
    method: "get",
    params: data,
  });
}
export function saveAwser(data) {
  return request({
    url: "/app/course/saveAnswerRecord",
    method: "post",
    data,
  });
}

export function lessoncartDel(data) {
  return request({
    url: "/app/shoppingcartCourse/del",
    method: "post",
    data,
  });
}

export function lessoncart(data) {
  return request({
    url: "/app/shoppingcartCourse/page",
    method: "get",
    params: data,
  });
}

export function lessoncartUpdate(data) {
  return request({
    url: "/app/shoppingcartCourse",
    method: "put",
    data,
  });
}
//一级类目

export function dazhelv(data) {
  return request({
    url: "/app/course/dazhelv",
    method: "post",
    data,
  });
}

export function orderinfoCoursePay(data) {
  return request({
    url: "/app/orderinfoCourse/unifiedOrder",
    method: "post",
    headers: {
      "content-type": "application/json",
      "app-id": "wx9086cb828f8c78d6",
      tradeType: "NATIVE",
    },
    data,
  });
}

export function orderinfoCourse(data) {
  return request({
    url: "/app/orderinfoCourse",
    method: "post",
    data,
  });
}

export function orderinfoCourseDetails(id) {
  return request({
    url: "/app/orderinfoCourse/" + id,
    method: "get",
    params: {},
  });
}

export function orderinfoCourseTake(id) {
  return request({
    url: "/app/orderinfoCourse/cancel/" + id,
    method: "put",
    params: {},
  });
}

export function orderinfoCourseDel(id) {
  return request({
    url: "/app/orderinfoCourse/" + id,
    method: "delete",
    params: {},
  });
}

export function orderinfoListCourse(data) {
  return request({
    url: "/app/orderinfoCourse/page",
    method: "get",
    params: data,
  });
}

//查询商品分类

export function goodscategory(data) {
  return request({
    url: "/app/goodscategory/tree",
    method: "get",
    params: data,
  });
}

//查询商品

export function goodList(data) {
  return request({
    url: "/app/goodsspu/page",
    method: "get",
    params: data,
  });
}

export function shoppingcartCount(data) {
  return request({
    url: "/app/shoppingcart/count",
    method: "get",
    params: data,
  });
}
export function goodListDetails(id) {
  return request({
    url: "/app/goodsspu/" + id,
    method: "get",
    params: {},
  });
}

export function shoppingcartAdd(data) {
  return request({
    url: "/app/shoppingcart",
    method: "post",
    data,
  });
}

export function shoppingcart(data) {
  return request({
    url: "/app/shoppingcart/page",
    method: "get",
    params: data,
  });
}

export function shoppingcartUpdate(data) {
  return request({
    url: "/app/shoppingcart",
    method: "put",
    data,
  });
}

export function shoppingcartDel(data) {
  return request({
    url: "/app/shoppingcart/del",
    method: "post",
    data,
  });
}

export function useraddress(data) {
  return request({
    url: "/app/useraddress/page",
    method: "get",
    params: data,
  });
}

export function useraddressAdd(data) {
  return request({
    url: "/app/useraddress",
    method: "post",
    data,
  });
}

export function useraddressDel(id) {
  return request({
    url: "/app/useraddress/" + id,
    method: "delete",
    params: {},
  });
}

export function orderinfoShop(data) {
  return request({
    url: "/app/orderinfo",
    method: "post",
    data,
  });
}
export function orderinfoShopApp(data) {
  return request({
    url: "/app/orderinfo/unifiedOrder",
    method: "post",
    headers: {
      "content-type": "application/json",
      "app-id": "wx9086cb828f8c78d6",
      tradeType: "NATIVE",
    },
    data,
  });
}

export function orderinfoDetails(id) {
  return request({
    url: "/app/orderinfo/" + id,
    method: "get",
    params: {},
  });
}

export function orderinfoList(data) {
  return request({
    url: "/app/orderinfo/page",
    method: "get",
    params: data,
  });
}

//订单删除

export function orderinfoDel(id) {
  return request({
    url: "/app/orderinfo/" + id,
    method: "delete",
    params: {},
  });
}

//订单取消n

export function orderinfoTake(id) {
  return request({
    url: "/app/orderinfo/cancel/" + id,
    method: "put",
    params: {},
  });
}
export function orderinfoReceive(id) {
  return request({
    url: "/app/orderinfo/receive/" + id,
    method: "put",
    params: {},
  });
}

export function refunds(data) {
  return request({
    url: "/app/orderinfo/refunds",
    method: "post",
    data,
  });
}

export function register(data) {
  return request({
    url: "/app/user/register",
    method: "post",
    data,
  });
}
export function getSmsCaptcha(data) {
  return request({
    url: "/app/user/smsCaptcha",
    method: "get",
    params: data,
  });
}
export function resetPassword(data) {
  return request({
    url: "/app/user/resetPassword",
    method: "post",
    data,
  });
}
